import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:delivery_application/common/color_extension.dart';
import 'package:delivery_application/common_widget/round_button.dart';
import 'package:delivery_application/view/login/login_view.dart';
import 'package:delivery_application/view/login/sign_up_view.dart';


class WelcomeView extends StatefulWidget {
  const WelcomeView({super.key});

  @override
  State<WelcomeView> createState() => _WelcomeViewState();
}

class _WelcomeViewState extends State<WelcomeView> {
  @override
  Widget build(BuildContext context) {
    var media = MediaQuery.of(context).size; 
    return Scaffold(
      backgroundColor: Color(0xff00AEEE),
      body: Column(
        children: [
          Stack(
            
            alignment: Alignment.bottomCenter,
            
            children: [
          
              Image.asset(
                "assets/img/hellow.png",
                width: media.width * 0.7,
                height: media.height * 0.3,
                fit: BoxFit.contain,
              ),
            ],
          ),

          SizedBox(
            height: media.width * 0.1,
            width: media.width,
          ),

          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 25),
            child: RoundButton(
              title: "登录",
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const LoginView(),
                  ),
                );
              },
            ),
          ),

          SizedBox(
            height: media.width * 0.1,
            width: media.width,
          ),

          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 25),
            child: RoundButton(
              title: "注册",
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const SignUpView(),
                  ),
                );
              },
            ),
          ),

          Image.asset(
            "assets/img/uavlogo.png",
            width: media.width * 0.6,
            height: media.height * 0.3,
            fit: BoxFit.contain,
          ),

          SizedBox(
            height: media.width * 0.1,
            width: media.width,
          ),

          Text(
            "西电核聚变团队提供技术支持",
            style: TextStyle(
                color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
          ),
        ],
      ),
    );
  }
}
